package com.hubiao.microservice.service1.service;

import com.hubiao.microservice.service2.service.Service2Api;

/**
 * Description
 *
 * @author hubiao
 * @since 2020-10-23 11:02
 */
@org.apache.dubbo.config.annotation.Service
public class Service1ApiImpl implements Service1Api {

    /**
     * 通过Reference注解生成Service2Api代理对象，来提供远程调用
     **/
    @org.apache.dubbo.config.annotation.Reference
    private Service2Api service2Api;

    /**
     * 重写service1Api接口
     *
     * @return
     */
    public String dubboService1() {
        //远程调用service2的接口
        String resultService1 = service2Api.dubboService();
        return "dubboService1 | " + resultService1;
    }
}
